﻿@*
    For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
*@
@{
    Layout = null;
}

@* <link href="~/lib/layui/css/layui.css" rel="stylesheet" />
<script src="~/lib/layui/layui.js"></script>
<script src="~/js/js.cookie.js"></script>
<script src="~/js/moment.js"></script>
<script src="~/lib/jquery/dist/jquery.js"></script> *@
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Gantt Chart</title>
    <script src="~/lib/jquery/dist/jquery.min.js"></script>
    <link href="~/lib/jquerygantt-master/gantt.css" rel="stylesheet" />
    <script src="/lib/jquery-gantt/jquery.fn.gantt.js"></script>
</head>
<body>
    <div id="gantt"></div>

    <script>
        $(document).ready(function () {
            $.ajax({
                url: '/Gantt/GetTasks',
                method: 'GET',
                success: function (data) {
                    $("#gantt").gantt({
                        source: data,
                        itemsPerPage: 10,
                        navigate: "scroll",
                        scale: "days",
                        maxScale: "months",
                        minScale: "hours",
                        onItemClick: function (data) {
                            alert("Task clicked: " + data.name);
                        },
                        onAddClick: function (dt, rowId) {
                            alert("Empty space clicked - add a task!");
                        }
                    });
                }
            });
        });
    </script>
</body>
</html>